/* 
    对日期格式化
    temp = yyyy-MM-dd
    temp = yyyy-MM-dd hh:mm:ss
*/
function format(date, temp) {
    temp = temp.replace("yyyy", date.getFullYear())
    temp = temp.replace("MM", date.getMonth() + 1)
    temp = temp.replace("dd", date.getDate())
    temp = temp.replace("hh", date.getHours())
    temp = temp.replace("mm", date.getMinutes())
    temp = temp.replace("ss", date.getSeconds())
    return temp
}

module.exports = format